package ks.client.controllers;

import ks.client.gui.UMGUI3;
import ks.managers.user.User;
import ks.client.gui.models.UserModel;

/**
 * Remove a User from the table. 
 * 
 * @author gregjoverton
 */
public class RemoveUserController {

	/** UMGUI3 being managed. */
	UMGUI3 gui;
	
	public RemoveUserController(UMGUI3 umg) {
		gui = umg;
	}

	public boolean remove(String name) {
		
		// update the underlying model.
		UserModel userModel = gui.getModel();
		if(!userModel.remove(name))
			return false;
		
		// make change visible.
		return gui.refreshTable();
	}

}
